<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D导航栏案例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        ul {
            list-style: none;
            margin: 10px;
        }
        
        li {
            width: 200px;
            height: 35px;
            perspective: 1000px;
            float: left;
            margin: 10px;
        }
        
        .box {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: all .5s;
        }
        
        .box div {
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 35px;
            color: white;
            position: absolute;
        }
        
        .box .front {
            transform: translateZ(17.5px);
            background-color: pink;
        }
        
        .box .bottom {
            background-color: skyblue;
            /* transform: translate3d(0, 50%, 50px) rotateX(-90deg); */
            transform: translateY(17.5px) rotateX(-90deg);
        }
        
        .box:hover {
            transform: rotateX(90deg);
        }
    </style>
</head>

<body>
    <ul>
        <li>
            <div class="box">
                <div class="front">贪吃蛇</div>
                <div class="bottom">球球大作战</div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">贪吃蛇</div>
                <div class="bottom">球球大作战</div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">贪吃蛇</div>
                <div class="bottom">球球大作战</div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">贪吃蛇</div>
                <div class="bottom">球球大作战</div>
            </div>
        </li>
    </ul>
</body>

</html>